<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<%
    JSONObject jsonData = new JSONObject();
    String sql = "select c1.id from Carinfo c1 left join (\n" +
            "select id,requestid,carId,driver,userid from CarUseApprove union all \n" +
            "select id,requestid,carId,driver,userid from formtable_main_27) c2 on c2.carId = c1.id \n" +
            "left join workflow_requestbase c3 on c2.requestid=c3.requestid \n" +
            "left join CarType c on c1.cartype = c.id\n" +
            "where c3.currentnodetype<>0 and c3.workflowid not in (select workflowid from carbasic where isuse=0)";
    rs.executeQuery( sql );
    String ids = "";
    if (rs.next()) {
        String id = Util.null2String( rs.getString( "id" ) );
        ids += "".equals( ids ) ? id : "," + id;
    }
    jsonData.put( "ids", ids );
    out.print( jsonData.toJSONString() );
%>
